home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / QuickDraw GX / QuickDraw GX Info / QuickDraw GX Interfaces / Interfaces & Libraries / Pascal Interfaces & Libraries / Pascal Interfaces / GraphicsToolbox.p < prev    next >
Encoding:
Text File  |  1994-04-02  |  3.9 KB  |  123 lines  |  [TEXT/MPS ]

  1. { graphics:
  2.     toolbox interfaces
  3.     by Cary Clark, Georgiann Delaney, Herb Derby, Michael Fairman, Pablo Fernicola, Dave Good, Josh Horwich, Barton House, Robert Johnson, Keith McGreggor, Mike Reed, Oliver Steele, David Van Brink, Chris Yerga
  4.     Copyright 1987 - 1994 Apple Computer, Inc.  All rights reserved.
  5. }
  6.  
  7. {$IFC UNDEFINED UsingIncludes}
  8. {$SETC UsingIncludes := 0}
  9. {$ENDC}
  10.  
  11. {$IFC NOT UsingIncludes}
  12.     UNIT GraphicsToolbox;
  13.     INTERFACE
  14. {$ENDC}
  15.  
  16. {$IFC UNDEFINED UsingGraphicsToolbox}
  17. {$SETC UsingGraphicsToolbox := 1}
  18.  
  19.  
  20. {$I+}
  21. {$SETC GraphicsToolboxIncludes := UsingIncludes}
  22. {$SETC UsingIncludes := 1}
  23. {$IFC UNDEFINED UsingWindows}
  24. {$I $$Shell(PInterfaces)Windows.p}
  25. {$ENDC}
  26. {$IFC UNDEFINED UsingFontTypes}
  27. {$I $$Shell(PInterfaces)FontTypes.p}
  28. {$ENDC}
  29. {$IFC UNDEFINED UsingGraphicsTypes}
  30. {$I $$Shell(PInterfaces)GraphicsTypes.p}
  31. {$ENDC}
  32. {$SETC UsingIncludes := GraphicsToolboxIncludes}
  33.  
  34.  
  35. { QD to QD GX Translator Types }
  36.  
  37. CONST
  38.     gxDefaultOptionsTranslation        = $0000;
  39.     gxOptimizedTranslation            = $0001;
  40.     gxReplaceLineWidthTranslation    = $0002;
  41.     gxSimpleScalingTranslation        = $0004;
  42.     gxSimpleGeometryTranslation        = $0008;    { implies simple scaling }
  43.     gxSimpleLinesTranslation        = $000C;    { implies simple geometry & scaling }
  44.     gxLayoutTextTranslation            = $0010;    { turn on gxLine layout (normally off) }
  45.     gxRasterTargetTranslation        = $0020;
  46.     gxPostScriptTargetTranslation    = $0040;
  47.     gxVectorTargetTranslation        = $0080;
  48.  
  49. TYPE
  50.     GxTranslationOption = LongInt;
  51.  
  52. CONST
  53.     gxContainsFormsBegin            = $0001;
  54.     gxContainsFormsEnd                = $0002;
  55.     gxContainsPostScript            = $0004;
  56.     gxContainsEmptyPostScript        = $0008;
  57.  
  58. TYPE
  59.     GxTranslationStatistic = LongInt;
  60.  
  61.  
  62. { QuickDraw Tag Types }
  63. CONST
  64.     gxQuickDrawPictTag = $70696374;                { 'pict' }
  65.  
  66. TYPE
  67.     GxQuickDrawPict = RECORD
  68.         { translator inputs }
  69.         options:        GxTranslationOption;
  70.         srcRect:        Rect;
  71.         styleStretch:    Point;
  72.  
  73.         { size of quickdraw picture data }
  74.         dataLength:        LongInt;
  75.  
  76.         { file alias }
  77.         alias:            GxBitmapDataSourceAlias;    
  78.         END;
  79.  
  80.     GxShapeSpoolFunction = ProcPtr;
  81.     GxUserViewPortFilter = ProcPtr;
  82.     GxConvertQDFontFunction = ProcPtr;
  83.  
  84.  
  85. { WindowRecord utilities }
  86. FUNCTION GXNewWindowViewPort(qdWindow: WindowPtr) : GxViewPort; C;
  87. FUNCTION GXGetWindowViewPort(qdWindow: WindowPtr) : GxViewPort; C;
  88. FUNCTION GXGetViewPortWindow(portOrder: gxViewPort) : WindowPtr; C;
  89.  
  90. { GDevice utilities }
  91. FUNCTION GXGetViewDeviceGDevice(theDevice: gxViewDevice) : GDHandle; C;
  92. FUNCTION GXGetGDeviceViewDevice(qdGDevice: GDHandle) : GxViewDevice; C;
  93.  
  94. { gxPoint utilities }
  95. PROCEDURE GXConvertQDPoint(VAR shortPt: Point; portOrder: GxViewPort; VAR fixedPt: GxPoint); C;
  96.  
  97. { mouse utilities }
  98. PROCEDURE GXGetGlobalMouse(VAR globalPt: GxPoint); C; { return mouse location in fixed-gxPoint global space }
  99. PROCEDURE GXGetViewPortMouse(portOrder: GxViewPort; VAR localPt: GxPoint); C;    { return fixed-gxPoint local mouse (gxViewPort == 0 --> default) }
  100.  
  101. { printing utilities }
  102. FUNCTION GXGetViewPortFilter(portOrder: GxViewPort; VAR refCon: LongInt) : GxUserViewPortFilter; C;
  103. PROCEDURE GXSetViewPortFilter(portOrder: GxViewPort; filter: GxUserViewPortFilter; refCon: LongInt); C;
  104.  
  105. { QD to QD GX Translator functions }
  106. PROCEDURE GXInstallQDTranslator(port: GrafPtr; options: GxTranslationOption; srcRect: Rect; dstRect: Rect;
  107.                                 styleStretch: Point; userFunction : GxShapeSpoolFunction; reference: LongInt); C;
  108. FUNCTION GXRemoveQDTranslator(port: GrafPtr; VAR statistic: GxTranslationStatistic) : gxTranslationStatistic; C;
  109. FUNCTION GXConvertPICTToShape(pict: PicHandle; options: GxTranslationOption; srcRect: Rect; dstRect: Rect;
  110.                             styleStretch: Point; destination: GxShape; stats: GxTranslationStatistic) : GxShape; C;
  111.     
  112. { Find the best GX style given a QD font and face. Called by the QD->GX translator }
  113. FUNCTION GXConvertQDFont(theStyle: gxStyle; txFont: LongInt; txFace: LongInt) : LongInt; C;
  114. FUNCTION GXGetConvertQDFont : GxConvertQDFontFunction; C;
  115. PROCEDURE GXSetConvertQDFont(userFuntion: GxConvertQDFontFunction); C;
  116.  
  117. {$ENDC}
  118.  
  119. {$IFC NOT UsingIncludes}
  120.     END.
  121. {$ENDC}
  122.  
  123.